import React from "react";
import {
    Route,
    Routes,
} from 'react-router-dom'
import GoodsList from "./pages/GoodsList";
import Home from "./pages/Home";
import My from "./pages/My";
import NewsList from "./pages/NewsList";
import NotFound from "./pages/NotFound";
import './App.css'
import MyNavLink from "./components/MyNavLink";
import Redirect from "./components/Redirect";
import AuthComponent from "./components/AuthComponent";
import Login from "./pages/Login";

function App() {
    return (
        <div id='container'>
            <MyNavLink></MyNavLink>

            <Routes>
                <Route path={'*'} element={<NotFound></NotFound>}></Route>
                <Route path={'/'} element={<Home></Home>}></Route>
                <Route path={'/goodsList'} element={<AuthComponent><GoodsList></GoodsList></AuthComponent>}></Route>
                <Route path={'newsList'} element={<NewsList></NewsList>}></Route>
                <Route path={'/my'} element={<AuthComponent><My></My></AuthComponent>}></Route>
                <Route path={'/home'} element={<Redirect to={'/'}></Redirect>}></Route>
                <Route path={"/login"} element={<Login/>}></Route>
            </Routes>
        </div>

    )
}
export default App


